function drawSummaryPie(obj, options) {
  obj.highcharts({
    chart: {
      plotBackgroundColor: null,
      plotBorderWidth: null,
      plotShadow: false,
      backgroundColor: '#F6F6F6',
      margin: [0, 0, 0, 0],
    },
    credits: {
      enabled: false
    },
    title: {
      text: '<b style="font-size:28px;font-weight:bold;margin:0;">' + options.name + '</b><br>' + options.value + options.unit,
      align: 'center',
      verticalAlign: 'middle',
      y: 0
    },
    tooltip: {
      enabled: false,
    },
    plotOptions: {
      pie: {
        allowPointSelect: false,
        cursor: 'pointer',
        dataLabels: {
          enabled: false,
        },
        showInLegend: false,
        innerSize: '80%'
      }
    },
    series: options.series,
  });
}

function drawColumnHttpcode(obj, options) {
  obj.highcharts({
    chart: {
      type: 'column',
      plotBackgroundColor: null,
      plotBorderWidth: null,
      plotShadow: false,
      backgroundColor: '#F6F6F6',
    },
    credits: {
      enabled: false
    },
    title: {
      text: '<b style="font-size:20px;font-weight:bold;margin:0;">' + options.name + '</b>',
    },
    xAxis: {
      type: 'category'
    },
    yAxis: {
      title: {
        text: null
      }
    },
    legend: {
      enabled: true,
    },
    plotOptions: {
      pie: {
        allowPointSelect: false,
        cursor: 'pointer',
        showInLegend: true,
        dataLabels: {
          enabled: false,
          format: '"{point.name}":{point.y}({point.percentage:.2f})',
          style: 'color:#FFFFFF'
        }
      },
      column: {
        borderWidth: 0,
        showInLegend: false,
        dataLabels: {
          enabled: true,
          format: '{point.y}'
        }
      }
    },
    tooltip: {
      headerFormat: '',
      pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y}</b><br/>'
    },

    series: options.series,
    drilldown: options.drilldown
  });
}
function drawPieHttpcode(obj, options) {
  obj.highcharts({
    chart: {
      type: 'pie',
      plotBackgroundColor: null,
      plotBorderWidth: null,
      plotShadow: false,
      backgroundColor: '#F6F6F6',
    },
    credits: {
      enabled: false
    },
    title: {
      text: '<b style="font-size:20px;font-weight:bold;margin:0;">' + options.name + '</b>',
    },
    plotOptions: {
      pie: {
        allowPointSelect: false,
        cursor: 'pointer',
        showInLegend: true,
        dataLabels: {
          enabled: false,
          format: '"{point.name}":{point.y}({point.percentage:.2f})',
          style: 'color:#FFFFFF'
        }
      }
    },
    tooltip: {
      headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
      formatter: function () {
        return '<b>' + this.point.name + '</b>: ' + Highcharts.numberFormat(this.y, 0, '.', ',') + '(' + this.percentage.toFixed(2) + ' %' + ')';
      }
    },
    series: options.series,
    drilldown: options.drilldown
  });
}
function drawColumn(obj, options) {
  obj.highcharts({
    chart: {
      backgroundColor: '#F6F6F6',
    },
    credits: {
      enabled: false
    },
    legend: {
      enabled: false
    },
    title: {
      text: null
    },
    xAxis: {
      type: 'datetime',
      //lineColor : '#990000',//自定义刻度颜色
      dateTimeLabelFormats: {
        millisecond: '%H:%M:%S.%L',
        second: '%H:%M:%S',
        minute: '%H:%M',
        hour: '%H:%M',
        day: '%m-%d',
        week: '%e. %b',
        month: '%b \'%y',
        year: '%Y'
      },
      labels: {
        rotation: 0,
        y: 15,
        align: 'center',
      }
    },
    yAxis: {
      allowDecimals: false,
      min: 0,
      title: {
        text: '单位：' + options.unit,
      }
    },
    tooltip: {
      formatter: function () {
        var mydate = new Date(this.x);
        var year = mydate.getFullYear();
        var month = parseInt(mydate.getMonth()) + 1;
        var day = mydate.getDate();
        var hour = mydate.getHours();
        var minute = mydate.getMinutes();
        var second = mydate.getSeconds();
        var date = year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second;
        return '' + '时间:' + date + '<br >' + options.name + ':' + Highcharts.numberFormat(this.y, 0, '.', ',') + options.unit;
      }
    },
    plotOptions: {
      series: {
        marker: {enabled: false},
        lineWidth: 1,
      },
      area: {
        stacking: 'normal',
        shadow: false,
      },
    },
    series: options.series,
  });
}
function drawArea(obj, options) {
  obj.highcharts({
    chart: {
      type: 'area',
      zoomType: 'x',
      backgroundColor: '#F6F6F6',
    },
    credits: {
      enabled: false
    },
    legend: {
      enabled: false
    },
    title: {
      text: null
    },
    xAxis: {
      type: 'datetime',
      //lineColor : '#990000',//自定义刻度颜色
      dateTimeLabelFormats: {
        millisecond: '%H:%M:%S.%L',
        second: '%H:%M:%S',
        minute: '%H:%M',
        hour: '%H:%M',
        day: '%m-%d',
        week: '%e. %b',
        month: '%b \'%y',
        year: '%Y'
      },
      //endOnTick:true,
      labels: {
        rotation: 0,
        y: 15,
//				formatter:function() {
//					var vDate = new Date(this.value);
//					return (parseInt(vDate.getMonth())+1)+"-"+vDate.getDate();
//				},
        align: 'center',
      }
    },
    yAxis: {
      min: 0,
      title: {
        text: '单位：' + options.unit,
      }
    },
    tooltip: {
      formatter: function () {
        var mydate = new Date(this.x);
        var year = mydate.getFullYear();
        var month = parseInt(mydate.getMonth()) + 1;
        var day = mydate.getDate();
        var hour = mydate.getHours();
        var minute = mydate.getMinutes();
        var second = mydate.getSeconds();
        var date = year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second;
        return '' + '时间:' + date + '<br >' + options.name + ':' + Highcharts.numberFormat(this.y, options.decimals || 0, '.', ',') + options.unit;
      }
    },
    plotOptions: {
      series: {
        marker: {enabled: false},
        lineWidth: 1,
      },
      area: {
        stacking: 'normal',
        shadow: false,
      },
    },
    series: options.series,
  });
}

function drawBar(obj, options) {
  obj.highcharts({
    chart: {
      backgroundColor: '#F6F6F6',
    },
    credits: {
      enabled: false
    },
    legend: {
      enabled: false
    },
    title: {
      text: null
    },
    xAxis: {
      categories: options.categories,
      labels: {
        formatter: function () {
          return '<span title="' + options.categories_title[this.value] + '" class="label">' + this.value + '</span>'
        },
        useHTML: true
      },
      tickLength: 0,
    },
    yAxis: {
      min: 0,
      title: {
        text: null
      },
      labels: {
        enabled: false
      },
      gridLineWidth: 0
    },
    tooltip: {
      hideDelay: 0,
      followPointer: true,
      formatter: function () {
        return '<b>' + options.categories_title[this.x] + "</b><br/>" + options.name + " : " + this.y + " " + options.unit
      }
    },
    plotOptions: {
      bar: {
        dataLabels: {
          enabled: true,
          crop: false,
          overflow: "none",
          formatter: function () {
            return this.y
          }
        }
      }
    },
    series: options.series
  });
}